package cn.java.com;

/**
 * @author HaleLv
 * @date 2021-02-07
 **/
public class PersonThisDemo {
    public static void main(String[] args) {
        Per p = new Per();
        Per pp = new Per("Hale",23);
        System.out.println(p);
        System.out.println(p.getAge());
        System.out.println(p.getName());
        System.out.println(pp.getName());
        System.out.println(pp.getAge());
    }
}

class Per {
    private int age;
    public String name;

    public Per(String name, int age){
        this.name = name;
        this.age = age;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Per(String name){
        this(name,34);
    }
    public Per(){
        this("unnamed");
    }
}
